package us.mooresr.webtroopmanager.client.ui;

import java.util.List;

import us.mooresr.webtroopmanager.shared.PersonSummary;
import us.mooresr.webtroopmanager.shared.Privilege;

import com.google.gwt.place.shared.Place;
import com.google.gwt.user.client.ui.IsWidget;

public interface PeopleListView extends IsWidget {
	/**
	 * Load the initial list of people into a PeopleListView.
	 * Existing data in the list is discarded.
	 * 
	 * @param data a List of PersonSummary instances to be placed in the view
	 */
	void setData(List<PersonSummary> data);
	
	void setPresenter(Presenter presenter);
	
	/**
	 * Add a single person to the existing list in a PeopleListView.
	 * Existing data in the list is kept.
	 * 
	 * @param person the PersonSummary instance to be added to the list
	 */
	void addPerson(PersonSummary person);
	
	/**
	 * Remove a single person from the existing list in a PeopleListView.
	 * 
	 * @param deletedId the Id of the person  to be removed from the list
	 */
	void removePerson(Long deletedId);
	
	void setStatus(String status);

	public interface Presenter {
		void goTo(Place place);
		void deletePerson(PersonSummary person);
		Boolean hasPermission(Privilege priv);
		Boolean isAllowed(Privilege priv, Long object);


	}
}
